/**
 * EggDemo2 static-logger
 * Created by pengj on 2019-5-17.
 */
'use strict';
module.exports = options => {
  console.log('middleware static-logger opt',options);
  return async function staticLogger(ctx, next) {
    if (ctx.url.startsWith('/public/')) {
      ctx.logger.info(`Request, [${ctx.method}] ${ctx.url} `);
    }
    await next();
  };
};
